//
// Copyright 2011 ReedRex Corp
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// 
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// StorageClient.h
// Cloud BookShelf
//
// Created by Shunichi Takagi on 11/02/25.
//

#import "Context/ObjectContext.h"
#import "Context/DataServiceQuery.h"
#import "Common/AzureTableUtil.h"
#import "Credential/AzureTableCredential.h"

#import "BlobContext.h"
#import "BlobContextDelegate.h"

#define TABLE_URL_FORMAT "http://%@.table.core.windows.net"
#define BLOB_URL_FORMAT "http://%@.blob.core.windows.net"

@interface StorageClient : NSObject<ODataDelegate, BlobContextDelegate> {
	NSString *tableServiceURL;
	NSString *blobServiceURL;
	NSString *accountName;
	NSString *accountKey;
@private
	NSDateFormatter *dateFormatter;
}

@property(retain, nonatomic) NSString *tableServiceURL;
@property(retain, nonatomic) NSString *blobServiceURL;
@property(retain, nonatomic) NSString *accountName;
@property(retain, nonatomic) NSString *accountKey;
@property(retain, nonatomic) NSDateFormatter *dateFormatter;

- (id) initWithAccountName:(NSString *)aName andKey:(NSString *)aKey;
- (ObjectContext *) createTableContext;
- (BlobContext *) createBlobContext;

@end
